package com.example.logisticsingle.constants;




/**
 * 响应枚举
 *
 */
public enum ResponseEnum {

    //0请求成功

    SUCCESS(RespConstants.SUCCESS_CODE,"请求成功"),

    //1用户登录权限响应
    LOGIN_SUCCESS(RespConstants.LOGIN_SUCCESS_CODE,"登录成功"),
    LOGIN_ACCOUNT_FAIL(RespConstants.LOGIN_ACCOUNT_ERROR_CODE,"该用户不存在，请重新登录"),
    LOGIN_PASSWORD_FAIL(RespConstants.LOGIN_PASSWORD_ERROR_CODE,"用户名或密码输入错误，请重新登录"),
    LOGIN_FAIL(RespConstants.LOGIN_FAIL_CODE,"登录失败"),
    LOGIN_TOKEN_FAIL(RespConstants.LOGIN_TOKEN_NOT_EXIST_CODE,"登录信息失效，请重新登录"),
    TOKEN_INVALID(RespConstants.TOKEN_INVALID_CODE,"无效Token访问"),
    AUTHORITY_FORBIDDEN(RespConstants.AUTHORITY_FORBIDDEN_CODE,"权限不足"),
    USER_CARD_ERROR(RespConstants.USER_CARD_ERROR_CODE,"用户身份证信息认证错误,请重新认证"),
    LOGOUT_TOKEN_NOT_EXIST(RespConstants.LOGOUT_TOKEN_NOT_EXIST_CODE,"退出失败，不存在该token"),
    USER_CARD_EXIST(RespConstants.USER_CARD_EXIST_CODE,"该用户身份证信息已存在"),
    CARD_EXIST(RespConstants.USER_CARD_EXIST_CODE,"此身份证号码已被注册，请联系客服。"),
    USER_DISABLED(RespConstants.USER_DISABLED_CODE,"该账户已被禁用，请联系管理人员"),
    USER_UNLOGIN(RespConstants.USER_UNLOGIN_CODE,"用户未登录"),
    USER_LOGINOUT(RespConstants.USER_LOGINOUT_CODE,"注销成功"),

    //2文件操作业务
    FILE_NOT_EXIST(RespConstants.FILE_NOT_EXIST_CODE,"文件不存在"),

    //3数据库操作相关
    DB_ERROR_CODE(RespConstants.DB_ERROR_CODE,"数据库异常"),

    //4请求操作相关
    REQUEST_INVALID(RespConstants.REQUEST_INVALID_CODE,"非法请求"),
    REQUEST_PARAMETER_NULL(RespConstants.REQUEST_PARAMETER_NULL_CODE,"请求参数不能为空"),
    REQUEST_PARAMETER_TYPE_ERROR(RespConstants.REQUEST_PARAMETER_TYPE_ERROR_CODE,"请求参数类型不支持"),
    REQUEST_FREQUENCY(RespConstants.REQUEST_FREQUENCY_CODE,"请求过于频繁"),

    //5短信
    SMS_SEND_SUCCESS(RespConstants.SMS_SEND_SUCCESS_CODE,"短信发送成功"),
    SMS_MOBILE_INVALID(RespConstants.SMS_MOBILE_INVALID_CODE,"手机格式错误"),
    SMS_VALIDATE_ERROR(RespConstants.SMS_VALIDATE_ERROR_CODE,"短信验证码错误"),
    SMS_OVER_MAX_NUM(RespConstants.SMS_VALIDATE_ERROR_CODE,"今日短信发送已超过最大限制"),
    SMS_SEND_FAIL(RespConstants.SMS_SEND_FAIL_CODE,"短信发送失败，未知错误"),

    //未知错误
    SYSTEM_SERVICE_UNABLE(RespConstants.SYSTEM_SERVICE_UNABLE_CODE,"服务不可用，请稍后再试"),
    UNKNOW_ERROR(RespConstants.UNKNOW_ERROR_CODE,"系统繁忙，请稍后再试");


    /**
     * 响应Code
     */
    private String code;
    /**
     * 响应消息
     */
    private String message;
    /**
     * 构造方法
     * @param code 响应Code
     * @param message	响应消息
     */
    ResponseEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    }

